import { Story } from "./entities"

export class diagram {
    constructor() {

    }
    public nodes: node[] = []
    public links: link[] = []
    public comments: comment[] = []
    public height: number = 600
    public width: number = 800
    public selectedId: string[] = []

    public getUIData(id: string, story: Story) {

    }
}
//代表在图里面的注释，可有位置，有链接，有内容，可以以图标格式显示或者直接显示全文
export class comment {
    constructor() {

    }
    public Id: string = ''
    public left: number = 0
    public top: number = 0
    public width: number = 0
    public height: number = 0
    public zindex: number = 0

    public linkx: number = 0
    public linky: number = 0
    public iconmode: boolean = false
    public showlink: boolean = true
    public fontsize: number = 12
    public text: string = ''
}
export class point {
    constructor() {

    }
    public x: number = 0
    public y: number = 0
    public r: number = 3
}
export class uielement {
    constructor() {

    }
    public id: string = ''

    public text: string = ''
    public memo: string = ''

    public borderfill = '#FFF'
    public boderWidth = 3
    public fill = '#000'
    public active: boolean = false
    public scalePoints: point[] = []
    public scaleRadius: number = 2
}
export class node extends uielement {
    constructor() {
        super()
    }

    public dataId: string = ''
    public datatype: string = ''
    public left: number = 0
    public top: number = 0
    public width: number = 0
    public height: number = 0
    public zindex: Number = 0
    public shape: string = 'rectangle'//rectangle,ellipse,5polygon,6poligon,trangle,7polygon,8polygon

    public linkPoints: point[] = []
    public linkRadius: number = 3
}

export class link extends uielement {
    constructor() {
        super()
    }
    //public objectId: string = ''

    public dataId: string = ''
    public startX: number = 0
    public startY: number = 0
    public endX: number = 0
    public endY: number = 0
    public grade: number = 0
    public zindex: Number = 0
    public sourceid: string = ''
    public sourcetype: string = ''
    public targetid: string = ''
    public targettype: string = ''
    public eventactive: string = 'none'
    // public sourceId: string = ''
    // public targetId: string = ''
    //public controlPoints: point[]
}